package com.scrcu.cloud.wechat.home;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ImportResource;
import org.springframework.core.env.Environment;

import java.util.TimeZone;

/**
 * @auther: 刘思良
 * @date: 2024/08/09 14:58
 * @description:
 * @version: 1.0.0
 */

@SpringBootApplication(scanBasePackages = {"com.scrcu.cloud.wechat.home"})
@MapperScan("com.scrcu.cloud.wechat.home.endpoint.*.mapper")
@ImportResource({"classpath*:META-INF/wechat-home-web/*.xml"})
public class WechatApplication {

    private static final Logger logger = LoggerFactory.getLogger(WechatApplication.class);

    public static void main(String[] args) {
        TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai"));
        // 全局设置系统的超时时间(单位:毫秒)
        System.setProperty("consumer.invoke.timeout", "50000");
        // 设置dubbo使用slf4j门面日志
        System.setProperty("dubbo.application.logger", "slf4j");
        // 设置ACVIP日志路径
        System.setProperty("sofa.logging.path", "/home/admin/logs/");
        ConfigurableApplicationContext context = SpringApplication.run(WechatApplication.class, args);
        Environment env = context.getBean(Environment.class);
        logger.info("应用[{}]启动成功", env.getProperty("spring.application.name"));
    }
}
